<!-- 个人中心 -->
<template>
    <view>
        <view class="cu-list menu menu-avatar bg-white padding-sm">
            <view class="cu-item">
                <view v-if="userInfoFromWx.avatarUrl" class="cu-avatar round lg" :style="{backgroundImage: 'url(' + userInfoFromWx.avatarUrl +')'}">
                     <view 
                        :class="['cu-tag', 'badge', (userInfoFromWx.gender && userInfoFromWx.gender === 1) ? 'icon-male bg-blue' : 'icon-female bg-pink']"
                    >
                    </view>
                </view>
                <view class='content flex-sub text-xxl'>
                    {{userInfoFromWx.nickName}}
                </view>
            </view>
        </view>

        <view class="cu-list menu">
            <view 
                @click="gotoEditUserInfo"
                class="cu-item arrow">
                <view class='content'>
                    <text class='icon-edit text-grey'></text>
                    <text class='text-grey'>个人信息</text>
                </view>
            </view>
            <view 
                @click="gotoJobRecord"
                class="cu-item arrow">
                <view class='content'>
                    <text class='icon-footprint text-grey'></text>
                    <text class='text-grey'>求职记录</text>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
import store from '@/store';

export default {
    data () {
        return {
            isShowModal: true
        };
    },
    computed: {
        userInfoFromWx() { // 用户授权信息 gender 0未知 1男 2女
            return this.$store.state.userInfoFromWx || {};
        },
    },
    onLoad() {
        wx.hideLoading();
    },
    onPullDownRefresh() {
        wx.stopPullDownRefresh(); // 停止下拉动作
    },
    methods: {
        gotoEditUserInfo() {
            wx.navigateTo({
                url: '/pages/user-info/main'
            })
        },
        gotoJobRecord() {
            wx.navigateTo({
                url: '/pages/job-record/main'
            })
        }
    }
}

</script>
<style lang='less' scoped>
.start-img {
    width: 100%;
    height: 100vh;
}
</style>